package org.bbelovic.devel.futureexample;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class FutureExampleClient<T> implements Runnable {

	private final FutureTask<T> ft;
	public FutureExampleClient(FutureTask<T> ft) {
		this.ft = ft;
	}

	@Override
	public void run() {
		try {
			System.out.println("Checking fibonacci result");
			T result = ft.get();
			System.out.println(result);
		}  catch (ExecutionException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}

}
